//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "ABON_PLIT.h"
#include "DMJ.h"
#include "BLANK_POISK.h"
#include "Main.h"
#include "Proc.h"
#include "uProc.h"
#include "KART_PRIB.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "cxButtons"
#pragma link "cxClasses"
#pragma link "cxContainer"
#pragma link "cxControls"
#pragma link "cxCustomData"
#pragma link "cxData"
#pragma link "cxDataStorage"
#pragma link "cxDBData"
#pragma link "cxEdit"
#pragma link "cxFilter"
#pragma link "cxGraphics"
#pragma link "cxGrid"
#pragma link "cxGridCustomTableView"
#pragma link "cxGridCustomView"
#pragma link "cxGridDBTableView"
#pragma link "cxGridLevel"
#pragma link "cxGridTableView"
#pragma link "cxGroupBox"
#pragma link "cxLookAndFeelPainters"
#pragma link "cxLookAndFeels"
#pragma link "cxStyles"
#pragma link "DBAccess"
#pragma link "IBC"
#pragma link "MemDS"
#pragma resource "*.dfm"
TfrABON_PLIT *frABON_PLIT;
//---------------------------------------------------------------------------
__fastcall TfrABON_PLIT::TfrABON_PLIT(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TfrABON_PLIT::AddExecute(TObject *Sender)
{
dmProc->POISK_KART(3,1,0);
}
//---------------------------------------------------------------------------
void __fastcall TfrABON_PLIT::Redakt()
{
frKART_PRIB= new TfrKART_PRIB(this);
frKART_PRIB->TIP=4;
frKART_PRIB->KOD_PRIB=dmOne->IBQTwo->FieldByName("KOD_PRIB")->AsInteger;
frKART_PRIB->ADD=0;
frKART_PRIB->NOM=dmOne->IBQTwo->FieldByName("NOM_ABON")->AsInteger;
frKART_PRIB->ZAPOLNI();
frKART_PRIB->ShowModal();
}
//---------------------------------------------------------------------------
void __fastcall TfrABON_PLIT::sgKOTELDBTableView1DblClick(TObject *Sender)
{
Redakt();	
}
//---------------------------------------------------------------------------

void __fastcall TfrABON_PLIT::sgKOTELDBTableView1KeyDown(TObject *Sender,
      WORD &Key, TShiftState Shift)
{
 if (Key == VK_RETURN){
  Redakt();
	}
}
//---------------------------------------------------------------------------
void __fastcall TfrABON_PLIT::Otkl_PribExecute(TObject *Sender)
{
//frKART_PRIB_VDGO->Stat=7;
//frKART_PRIB_VDGO->TIP=3;
//frKART_PRIB_VDGO->STAT_OTKL=1;
//frKART_PRIB_VDGO->VID=dsetPLITA->FieldByName("VID_PRIB")->AsInteger;
//frKART_PRIB_VDGO->KOD_PRIB=dsetPLITA->FieldByName("KOD_PL")->AsInteger;
//frKART_PRIB_VDGO->NOM_ABON=dsetPLITA->FieldByName("NOM_ABON")->AsInteger;
//frKART_PRIB_VDGO->Obnovi();
//frKART_PRIB_VDGO->ShowModal();
}
//---------------------------------------------------------------------------
void __fastcall TfrABON_PLIT::FormShow(TObject *Sender)
{
dmProc->INF_PO_PRIB(3);
}
//---------------------------------------------------------------------------
void __fastcall TfrABON_PLIT::actESCExecute(TObject *Sender)
{
frABON_PLIT->Close();
}
//---------------------------------------------------------------------------

